import { get, post, del } from "../utils/request";

export const loadCart = () => get("/api/v1/shop_carts");

/**
 * 添加商品到购物车
 * @param {*} product 商品id
 * @param {*} amount 增加或减少
 * @param {*} price 价格
 * @returns
 */
export const addCart = (product, amount, price) =>
  post("/api/v1/shop_carts", { product, amount, price });

export const delCart = (id) => del("/api/v1/shop_carts/" + id);
